const path = require("path");
const theme = path.resolve(__dirname, "src/assets/css/index.less");

// const server = "https://service.neuqsoft.com/ggfw/dev";
// const server = "http://172.30.3.74:7021/app";
// const server = "http://172.30.3.74:5567"; //

// const server = "http://10.19.92.212:7021/app"; //
const server = "https://service.neuqsoft.com/ggfw/citizen/"; //

module.exports = {
  publicPath: process.env.NODE_ENV === "production" ? "/ggfw/citizen" : "/",
  // publicPath: process.env.NODE_ENV === "production" ? "/citizen" : "/",

  indexPath: "index.html",

  outputDir: `dist-${require("./package").version}`,

  assetsDir: "static",

  productionSourceMap: false,

  lintOnSave: true,

  devServer: {
    port: 8880,
    proxy: {
      "/app": {
        target: server,
        changeOrigin: true,
        pathRewrite: {},
        secure: false
      },
      "/auth": {
        target: server
      }
    }
  },

  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [theme]
    }
  },

  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          // https://youzan.github.io/vant/#/zh-CN/theme
          // https://github.com/youzan/vant/blob/dev/src/style/var.less
          // hack: `true; @import "${theme}";`,
          blue: "#4877E3",
          "gray-5": "#bdc2d2",
          "gray-6": "#6c7289",
          "gray-7": "#384253",
          "gray-8": "#3a435e",
          "popup-round-border-radius": "10px"
        }
      }
    }
  }
};
